1
2
3
4 package joeq.Linker.ELF;
5
6 import java.util.Iterator;
7 import java.util.List;
8 import java.io.IOException;
9 import java.io.RandomAccessFile;
10
11 /***
12 * Browser
13 *
14 * @author John Whaley
15 * @version $Id: Browser.java 1985 2004-10-08 08:43:02Z joewhaley $
16 */
17 public class Browser {
18
19 public static void main(String[] args) throws IOException {
20 RandomAccessFile f = new RandomAccessFile(args[0], "r");
21 browseFile(f);
22 }
23
24 public static void browseFile(RandomAccessFile file) throws IOException {
25 ELFRandomAccessFile f = new ELFRandomAccessFile(file);
26 List sections = f.getSections();
27 for (Iterator i=sections.iterator(); i.hasNext(); ) {
28 Section s = (Section) i.next();
29 System.out.println(s);
30 }
31 }
32
33 }